import request from '@/utils/request'
import {parseStrEmpty} from "@/utils/ruoyi";

// 查询库存查询列表
export function listStock(query) {
    return request({
        url: '/wms/stock/list',
        method: 'get',
        params: query
    })
}

export function overdueStock(query) {
    return request({
        url: '/wms/stock/overdueList',
        method: 'get',
        params: query
    })
}

// 查询库存查询详细
export function getStock(stockId) {
    return request({
        url: '/wms/stock/' + parseStrEmpty(stockId),
        method: 'get'
    })
}

// 新增库存查询
export function addStock(data) {
    return request({
        url: '/wms/stock',
        method: 'post',
        data: data
    })
}

// 修改库存查询
export function updateStock(data) {
    return request({
        url: '/wms/stock',
        method: 'put',
        data: data
    })
}

// 删除库存查询
export function delStock(stockId) {
    return request({
        url: '/wms/stock/' + stockId,
        method: 'delete'
    })
}

// 冻结/解冻库存
export function disablesStock(data) {
    return request({
        url: '/wms/stock/disables',
        method: 'post',
        data: data
    })
}

export function directOut(data) {
    return request({
        url: '/wms/stock/directOut',
        method: 'post',
        data: data
    })
}

export function checkListStock(query) {
    return request({
        url: '/wms/stock/checkStockList',
        method: 'get',
        params: query
    })
}
